<?php /* Copyright 2010 Karl R. Wilcox 

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License. */


function makeOrd_cross2 ($node) {
  $ord_data = array (
  'cross-pierced' => array ( 'body' => '<path d="M 350,0 L 650,0 L 650,350 L 350,350 L 350,0 z M 350,650 L 650,650 L 650,1200 L 350,1200 L 350,650 z M 0,350 L 350,350 L 350,650 L 0,650 L 0,350 z M 650,350 L 1000,350 L 1000,650 L 650,650 L 650,350 z" />',
        'voided' => '<path d="M 350,-100 L 350,350 L -100,350 L -100,650 L 350,650 L 350,1400 L 650,1400 L 650,650 L 1100,650 L 1100,350 L 650,350 L 650,-100 L 350,-100 z M 390,40 L 390,350 L 610,350 L 610,40 L 390,40 z M 650,390 L 960,390 L 960,610 L 650,610 L 650,390 z M 390,650 L 390,1160 L 610,1160 L 610,650 L 390,650 z M 40,390 L 40,610 L 350,610 L 350,390 L 40,390 z M 390,390 L 610,390 L 610,610 L 390,610 L 390,390 z" fill-rule="evenodd" />',
        'cotise1' => '<path d="M -100,680 L 320,680 L 320,1240 L 290,1240 L 290,710 L -100,710 L -100,680 z M -100,320 L 320,320 L 320,-40 L 290,-40 L 290,290 L -100,290 L -100,320 z M 1100,680 L 680,680 L 680,1240 L 710,1240 L 710,710 L 1100,710 L 1100,680 z M 1100,320 L 680,320 L 680,-40 L 710,-40 L 710,290 L 1100,290 L 1100,320 z" />',
        'cotise2' => '<path d="M -100,740 L 260,740 L 260,1300 L 230,1300 L 230,770 L -100,770 L -100,740 z M -100,260 L 260,260 L 260,-100 L 230,-100 L 230,230 L -100,230 L -100,260 z M 1100,740 L 740,740 L 740,1300 L 770,1300 L 770,770 L 1100,770 L 1100,740 z M 1100,260 L 740,260 L 740,-100 L 770,-100 L 770,230 L 1100,230 L 1100,260 z" />', ),
  'cross-2fretty' => array ( 'body' => array (
            'NC' => '<path d="M 410,0 L 410,400 L 470,400 L 470,0 L 410,0 z M 530,0 L 530,520 L 590,520 L 590,0 L 530,0 z M 410,480 L 410,1200 L 470,1200 L 470,480 L 410,480 z M 530,600 L 530,1200 L 590,1200 L 590,600 L 530,600 z M 0,410 L 520,410 L 520,470 L 0,470 L 0,410 z M 600,410 L 1000,410 L 1000,470 L 600,470 L 600,410 z M 0,530 L 400,530 L 400,590 L 0,590 L 0,530 z M 480,530 L 1000,530 L 1000,590 L 480,590 L 480,530 z" />',
            'CH' => '<path d="m 410,100 0,400 60,0 0,-400 -60,0 z m 120,0 0,520 60,0 0,-520 -60,0 z m -120,480 0,620 60,0 0,-620 -60,0 z m 120,120 0,500 60,0 0,-500 -60,0 z M 0,510 l 520,0 0,60 -520,0 0,-60 z m 600,0 400,0 0,60 -400,0 0,-60 z M 0,630 l 400,0 0,60 -400,0 0,-60 z m 480,0 520,0 0,60 -520,0 0,-60 z" />')),
  'cross-3fretty' => array ( 'body' => array (
            'NC' => '<path d="M 400,0 L 440,0 L 440,390 L 400,390 L 400,0 z M 560,0 L 600,0 L 600,390 L 560,390 L 560,0 z M 400,0 L 440,0 L 440,390 L 400,390 L 400,0 z M 400,450 L 440,450 L 440,550 L 400,550 L 400,450 z M 560,450 L 600,450 L 600,550 L 560,550 L 560,450 z M 400,610 L 440,610 L 440,1200 L 400,1200 L 400,610 z M 560,610 L 600,610 L 600,1200 L 560,1200 L 560,610 z M 480,0 L 520,0 L 520,470 L 480,470 L 480,0 z M 480,530 L 520,530 L 520,1200 L 480,1200 L 480,530 z M 0,400 L 470,400 L 470,440 L 0,440 L 0,400 z M 0,560 L 470,560 L 470,600 L 0,600 L 0,560 z M 0,480 L 390,480 L 390,520 L 0,520 L 0,480 z M 450,480 L 550,480 L 550,520 L 450,520 L 450,480 z M 530,400 L 1000,400 L 1000,440 L 530,440 L 530,400 z M 530,560 L 1000,560 L 1000,600 L 530,600 L 530,560 z M 610,480 L 1000,480 L 1000,520 L 610,520 L 610,480 z" />',
            'CH' => '<path d="m 400,100 40,0 0,390 -40,0 0,-390 z m 160,0 40,0 0,390 -40,0 0,-390 z m -160,0 40,0 0,390 -40,0 0,-390 z m 0,450 40,0 0,100 -40,0 0,-100 z m 160,0 40,0 0,100 -40,0 0,-100 z m -160,160 40,0 0,490 -40,0 0,-490 z m 160,0 40,0 0,490 -40,0 0,-490 z m -80,-610 40,0 0,470 -40,0 0,-470 z m 0,530 40,0 0,570 -40,0 0,-570 z M 0,500 l 470,0 0,40 -470,0 0,-40 z m 0,160 470,0 0,40 -470,0 0,-40 z m 0,-80 390,0 0,40 -390,0 0,-40 z m 450,0 100,0 0,40 -100,0 0,-40 z m 80,-80 470,0 0,40 -470,0 0,-40 z m 0,160 470,0 0,40 -470,0 0,-40 z m 80,-80 390,0 0,40 -390,0 0,-40 z" />')),
  'cross-formy' => array ( 'body' =>  array (
            'NC' => '<path d="M200,0 A 450,450 0,0,1 400,400 A 450,450 0,0,1 0,200L0,800 A 450,450, 0,0,1 400,600 A 400,500 0,0,1 100,1200 L 900,1200 A 400,500 0,0,1 600,600 A 450,450 0,0,1 1000,800 L 1000,200 A 450,450 0,0,1 600,400 A 450,450 0,0,1 800,0 Z" />',
            'CH' => '<path d="M200,200 A 450,450 0,0,1 400,600 A 450,450 0,0,1 0,400L0,1000 A 450,450, 0,0,1 400,800 A 400,500 0,0,1 100,1400 L 900,1400 A 400,500 0,0,1 600,800 A 450,450 0,0,1 1000,1000 L 1000,400 A 450,450 0,0,1 600,600 A 450,450 0,0,1 800,200 Z" />',), ),
  'fillet-cross' => array ( 'shape_spec' => array ( 'NC' => 'X470Y-100a60C570A570c60E570C770e60G770E570g60A570G570', 'CH' => 'X470Y200a60C470A570c60E570C570e60G570E570g60A570G470' ),),
  );

  $name = $node->get_attribute('subtype');
  if ( isset($ord_data[$name]) ) {
    if ( is_array($ord_data[$name]) ) {
      $retval = $ord_data[$name];
    } else {
      $retval = array ( 'body' => $ord_data[$name] );
    }
  } else {
    my_trigger_error ( "No cross $name", E_USER_WARNING, __FILE__, __LINE__ );
    $retval = array ( 'body' => '<g/>');
  }
  return $retval;
}

?>
